<#import "/home/index_layout.ftl" as layout>
<#import "/widget/hotel_widget.ftl" as hotelWidgetLayout>
<@layout.layout legend="Hotel Results">
<#if model.hotels.hotelList??>
	<#list model.hotels.hotelList.hotelSummary as hotel >
		<@hotelWidgetLayout.widget hotel />
	</#list>
<#else>
    <#-- Error widget inserted here -->
    <h1> TODO: Error page has to be created as a macro !</h1>
    <h2> No hotels has been found !</h2>
    <pre>
        <#if model.hotels.eanWsError.category??>
            <h3>Category</h3>
            <span style="font-size: 20px">${model.hotels.eanWsError.category}</span>
        </#if>
        <#if model.hotels.eanWsError.errorAttributes??>
            <h3>Error Attributes</h3>
            <span style="font-size: 20px">${model.hotels.eanWsError.errorAttributes}</span>
        </#if>
        <#if model.hotels.eanWsError.exceptionConditionId??>
            <h3>Exception Condition ID</h3>
             <span style="font-size: 20px">${model.hotels.eanWsError.exceptionConditionId}</span>
        </#if>
        <#if model.hotels.eanWsError.handling??>
            <h3>Error Handling</h3>
            <span style="font-size: 20px">${model.hotels.eanWsError.handling}</span>
        </#if>
        <#if model.hotels.eanWsError.presentationMessage??>
            <h3>Presentation Message</h3>
            <span style="font-size: 20px">${model.hotels.eanWsError.presentationMessage}</span>
        </#if>
        <#if model.hotels.eanWsError.verboseMessage??>
            <h3>Verbose Message</h3>
            <span style="font-size: 20px">${model.hotels.eanWsError.verboseMessage}</span>
        </#if>
    </pre>
</#if>
    <script src="${springMacroRequestContext.getContextPath()}/resources/js/hotel_widget.js"/></script>
</@layout.layout>
